<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script>
        //定义变量
        var i,j,h;
        //打印三角形219970413刘慧
        for(i = 1 ; i <= 5 ; i++){
            for ( j = 1 ; j <= 5-i ; j++){
                document.write("&nbsp;");//前面的空格
            }
            for ( k = 1 ; k <= i ; k++){
                document.write("*");//打印*与空格
                document.write("&nbsp;");
            }
            for( j = 1 ; j <= 5-i ; j++){
                document.write("&nbsp;");//打印后面的空格
            }
            document.write("<br>")//换行
        }

        //打印平行四边形
        for( i = 1 ; i <= 5 ; i++){
            for( j = i ; j <= 5 ; j++){
                document.write("&nbsp;");
            }
            for( k = 1 ; k <= 5 ; k++){
                document.write("*");
                document.write("&nbsp;");
            }
            document.write("<br>");
        }

        //打印菱形
        for( i = 1 ; i <= 3 ; i++){
            //打印前三行
            for( j = 1 ; j <= 3-i ; j++){
                document.write("&nbsp;&nbsp;");
            }
            for( k = 1 ; k <= 2*i-1 ; k++){
                document.write("*");
                document.write("&nbsp;");
            }
            document.write("<br>");
        }
        //打印后面两行
        for( i = 1 ; i <= 2 ; i++){
            for( j = 1 ; j <= i ; j++){
                document.write("&nbsp;&nbsp;");
            }
            for( k = 1 ; k <= 5-2*i ; k++){
                document.write("*");
                document.write("&nbsp;");
            }
            document.write("<br>");
        }
    </script>
</head>
<body>  
</body>
</html>